<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>全选全不选</title>
		<script src="jquery-3.2.1.min.js" type="text/javascript">
		</script>
		<script type="text/javascript">
			$(function(){
				$("#shop1").click(function(){
					var a=this.checked;
					$("input[type=checkbox]").prop("checked",a);
				});
			});
		</script>
	</head>
	<body>
		<input type="checkbox" name="shop" value="手机"/>手机<br />
		<input type="checkbox" name="shop" value="电脑" />电脑<br />
		<input type="checkbox" name="shop" value="手表" />手表<br />
		<input type="checkbox" name="shop" value="餐具" />餐具<br />
		<input type="checkbox" name="shop" value="厨具" />厨具<br />
		<input type="checkbox" name="shop" value="床上用品" />床上用品<br />
		<input type="checkbox" name="shop" value="电视" />电视<br />
		<input type="checkbox" name="shop" id="shop1" value="全选" />全选<br />
		
	</body>
</html>
